package com.google.gwt.sample.dynatablerf.shared;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class GrifoSharedConvertUtil {

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static List convertToList(Collection collection) {
		List list;
		if (collection instanceof List)
			list = (List) collection;
		else
			list = new ArrayList(collection);
		return list;
	}

	public static String convertToString(double d) {
		return Double.toString(d);
	}

	public static Double round(double d) {
		return Math.round(d * 1000) / 1000.0;
	}

	public static Integer converToInteger(Long l) {
		return l.intValue();
	}
}
